/*******************************************************************************
 * Size: 15 px
 * Bpp: 4
 * Opts: --no-compress --format lvgl --font D:\heiti.ttf --symbols 星期一二三四五六日 -o C:\Users\49542\Desktop\my_font_15.c --bpp 4 --size 15
 ******************************************************************************/

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif

#ifndef MY_FONT_15
#define MY_FONT_15 1
#endif

#if MY_FONT_15

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+4E00 "一" */
    0x5, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x2,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x2,
    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0,

    /* U+4E09 "三" */
    0x0, 0xef, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x0,
    0x3, 0x32, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2,
    0x11, 0x11, 0x11, 0x11, 0x0, 0x0, 0x0, 0xff,
    0xff, 0xff, 0xff, 0xd0, 0x0, 0x0, 0x2, 0x11,
    0x11, 0x11, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x2f, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0x10, 0x43, 0x33, 0x33, 0x33, 0x33,
    0x33, 0x40,

    /* U+4E8C "二" */
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x9, 0xee, 0xee, 0xee, 0xee, 0xf8, 0x0, 0x0,
    0x46, 0x66, 0x66, 0x66, 0x66, 0x30, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x1, 0x66, 0x66, 0x66, 0x66,
    0x66, 0x66, 0x71, 0x2e, 0xee, 0xee, 0xee, 0xee,
    0xee, 0xee, 0x10,

    /* U+4E94 "五" */
    0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x30, 0x0,
    0x0, 0xc, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0,
    0xe, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf,
    0x10, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff,
    0xff, 0x80, 0x0, 0x0, 0x0, 0x5d, 0x0, 0xa,
    0x80, 0x0, 0x0, 0x0, 0x7b, 0x0, 0xa, 0x70,
    0x0, 0x0, 0x0, 0x99, 0x0, 0xb, 0x70, 0x0,
    0x0, 0x0, 0xb6, 0x0, 0xb, 0x60, 0x0, 0x0,
    0x0, 0xe4, 0x0, 0xc, 0x60, 0x0, 0xfe, 0xee,
    0xff, 0xee, 0xef, 0xfe, 0xf0, 0x43, 0x33, 0x33,
    0x33, 0x33, 0x33, 0x30,

    /* U+516D "六" */
    0x0, 0x0, 0xa, 0x20, 0x0, 0x0, 0x0, 0x0,
    0x0, 0xcd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2,
    0xf7, 0x0, 0x0, 0x1, 0x10, 0x0, 0x5, 0x20,
    0x0, 0x1, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xf2, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0,
    0x0, 0x30, 0x0, 0x30, 0x0, 0x0, 0x0, 0x5f,
    0x40, 0x1f, 0x90, 0x0, 0x0, 0xd, 0xc0, 0x0,
    0x6f, 0x50, 0x0, 0x9, 0xf2, 0x0, 0x0, 0xaf,
    0x20, 0x5, 0xf6, 0x0, 0x0, 0x0, 0xec, 0x4,
    0xfa, 0x0, 0x0, 0x0, 0x5, 0xf6, 0x7c, 0x0,
    0x0, 0x0, 0x0, 0x7, 0x10, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0,

    /* U+56DB "四" */
    0x4f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe4, 0xe0,
    0x3, 0xe0, 0xc5, 0x0, 0x5e, 0x4e, 0x0, 0x4d,
    0xc, 0x50, 0x5, 0xd4, 0xe0, 0x6, 0xb0, 0xc5,
    0x0, 0x5d, 0x4e, 0x0, 0xa7, 0xc, 0x50, 0x5,
    0xd4, 0xe0, 0x2f, 0x10, 0xc5, 0x0, 0x5d, 0x4e,
    0x1d, 0x70, 0xa, 0xec, 0xc5, 0xd4, 0xe5, 0xa0,
    0x0, 0x3, 0x43, 0x5d, 0x4e, 0x0, 0x0, 0x0,
    0x0, 0x5, 0xd4, 0xe0, 0x0, 0x0, 0x0, 0x0,
    0x5d, 0x4f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe4,
    0xe0, 0x0, 0x0, 0x0, 0x0, 0x5e, 0x1, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0,

    /* U+65E5 "日" */
    0xf, 0xff, 0xff, 0xff, 0xff, 0x60, 0xf4, 0x0,
    0x0, 0x0, 0xe6, 0xf, 0x30, 0x0, 0x0, 0xe,
    0x60, 0xf3, 0x0, 0x0, 0x0, 0xe6, 0xf, 0x30,
    0x0, 0x0, 0xe, 0x60, 0xfd, 0xcc, 0xcc, 0xcc,
    0xf6, 0xf, 0x63, 0x33, 0x33, 0x3f, 0x60, 0xf3,
    0x0, 0x0, 0x0, 0xe6, 0xf, 0x30, 0x0, 0x0,
    0xe, 0x60, 0xf3, 0x0, 0x0, 0x0, 0xe6, 0xf,
    0x53, 0x33, 0x33, 0x3e, 0x60, 0xfd, 0xdd, 0xdd,
    0xdd, 0xf6, 0xf, 0x30, 0x0, 0x0, 0xe, 0x60,

    /* U+661F "星" */
    0x0, 0xdf, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0,
    0xd6, 0x0, 0x0, 0x0, 0xe, 0x50, 0x0, 0xde,
    0xee, 0xee, 0xee, 0xef, 0x50, 0x0, 0xd7, 0x11,
    0x11, 0x11, 0x1e, 0x50, 0x0, 0xdd, 0xbb, 0xbb,
    0xbb, 0xbf, 0x50, 0x0, 0x33, 0x33, 0x33, 0x33,
    0x33, 0x10, 0x0, 0x37, 0x0, 0x3b, 0x0, 0x0,
    0x0, 0x0, 0xce, 0x54, 0x7f, 0x44, 0x45, 0x40,
    0x8, 0xfb, 0xbb, 0xcf, 0xbb, 0xbb, 0x90, 0x6f,
    0x41, 0x0, 0x4f, 0x0, 0x1, 0x0, 0x4, 0x1e,
    0xee, 0xef, 0xee, 0xee, 0x40, 0x2, 0x11, 0x11,
    0x4f, 0x11, 0x11, 0x11, 0x5f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0,

    /* U+671F "期" */
    0x0, 0xe4, 0x2, 0xf1, 0x1f, 0xee, 0xef, 0x2,
    0xe5, 0x12, 0xf3, 0x1f, 0x10, 0x4e, 0x1d, 0xfd,
    0xcd, 0xfd, 0x2f, 0x10, 0x4e, 0x0, 0xd4, 0x1,
    0xf1, 0x1f, 0x10, 0x4e, 0x0, 0xde, 0xee, 0xf1,
    0x1f, 0xee, 0xee, 0x0, 0xd4, 0x1, 0xf1, 0x1f,
    0x10, 0x4e, 0x0, 0xde, 0xee, 0xf1, 0x1f, 0x10,
    0x4e, 0x0, 0xd4, 0x1, 0xf1, 0x2f, 0xbb, 0xce,
    0x6e, 0xfe, 0xdd, 0xfe, 0x5f, 0x11, 0x5e, 0x0,
    0x61, 0x4, 0x21, 0x7c, 0x0, 0x4e, 0x4, 0xf3,
    0x7, 0xd1, 0xd7, 0x0, 0x4e, 0x2e, 0x50, 0x0,
    0xaa, 0xf1, 0x1, 0x6e, 0x15, 0x0, 0x0, 0xc,
    0x60, 0x3, 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x10
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 240, .box_w = 15, .box_h = 3, .ofs_x = 0, .ofs_y = 4},
    {.bitmap_index = 23, .adv_w = 240, .box_w = 15, .box_h = 12, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 113, .adv_w = 240, .box_w = 15, .box_h = 11, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 196, .adv_w = 240, .box_w = 14, .box_h = 12, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 280, .adv_w = 240, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 371, .adv_w = 240, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 456, .adv_w = 240, .box_w = 11, .box_h = 13, .ofs_x = 2, .ofs_y = -1},
    {.bitmap_index = 528, .adv_w = 240, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 626, .adv_w = 240, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_0[] = {
    0x0, 0x9, 0x8c, 0x94, 0x36d, 0x8db, 0x17e5, 0x181f,
    0x191f
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 19968, .range_length = 6432, .glyph_id_start = 1,
        .unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 9, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    }
};



/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LV_VERSION_CHECK(8, 0, 0)
/*Store all the custom data of the font*/
static  lv_font_fmt_txt_glyph_cache_t cache;
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 1,
    .bpp = 4,
    .kern_classes = 0,
    .bitmap_format = 0,
#if LV_VERSION_CHECK(8, 0, 0)
    .cache = &cache
#endif
};


/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t my_font_15 = {
#else
lv_font_t my_font_15 = {
#endif
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 14,          /*The maximum line height required by the font*/
    .base_line = 2,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
    .underline_position = -1,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc           /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};



#endif /*#if MY_FONT_15*/

